package leetcodecompetition.S100;

import org.junit.jupiter.api.Test;

import java.util.Arrays;

public class T6324 {
    public int maximizeGreatness(int[] nums) {
        int len=nums.length;
        Arrays.sort(nums);
        int right=1;
        int left=0;
        int sum=0;
        while (right<len){
            if (nums[right]>nums[left]){
                sum++;
                right++;
                left++;
            }else {
                right++;
            }
        }
        return sum;
    }
    @Test
    public void test() {
        int[] ints={1,2,3,4};
        System.out.println(maximizeGreatness(ints));

    }
}
